
//
//  MineShouCangController.m
//  FD
//
//  Created by Yasin on 2018/10/16.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "MineShouCangController.h"
#import "MineShouCangCell.h"
#import "WSGoodsDetailController.h"

@interface MineShouCangController ()<UITableViewDelegate,UITableViewDataSource>
/**talbeView*/
@property (nonatomic,  strong) UITableView *tv;

@end

@implementation MineShouCangController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"我的收藏";
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.tv.frame = self.view.bounds;
    [self.view addSubview:self.tv];
    self.tv.tableFooterView = [UIView new];
}

- (UITableView *)tv {
    if (!_tv) {
        _tv = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
        //代理
        _tv.delegate = self;
        _tv.dataSource = self;
        //注册cell
        [_tv registerNib:[UINib nibWithNibName:@"MineShouCangCell" bundle:nil] forCellReuseIdentifier:@"MineShouCangCell"];
    }
    return _tv;
}

#pragma mark - 代理

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 6;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MineShouCangCell   *cell = [tableView dequeueReusableCellWithIdentifier:@"MineShouCangCell"];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 100;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    WSGoodsDetailController *detailVC = [WSGoodsDetailController new];
    [self.navigationController pushViewController:detailVC animated:YES];
}

@end
